﻿<?php
	require_once('template/template1.phtml');
?>	
<script>
	function onXoaHieu(id, ten_nhan_hieu)
	{
		if (confirm('Bạn muốn xóa nhóm '+ ten_nhan_hieu ))
		{
			window.location.href = '<?php echo $config_basedir. "/WKSCP/hieu_CMS.php?action=DEL&id="; ?>' + id;
		}
		return false;
	} 
</script>
	<h2>Danh sách nhãn hiệu
		<span class="floatright"><a style='color:yellow;' href ='hieu_CMS.php?action=ADD'> Thêm nhãn hiệu </a></span>
	</h2>
    <div id="productList">
        <table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid">
            <caption>Nhãn hiệu</caption>
            <thead>
                <tr>
                    <th style="width: 200px">Logo </th>
                    <th style="width: auto">Nhãn hiệu</th>
                    <th style="width: 50px; text-align:center">Sửa</th>
					<th style="width: 70px; text-align:center">Xóa</th>
                </tr>
            </thead>
            <tbody>
<?php			
		foreach($hieu as $value){
		echo	"<tr>";
		echo		"<td>";
		echo			"<img alt='{$value['ten_nhan_hieu']}' src='#xxx'>";
		echo		"</td>";
		echo		"<td>";
		echo			$value['ten_nhan_hieu'];		
		echo		"</td>";
		echo		"<td align='center'><a href='hieu_CMS.php?action=EDIT&id={$value['id_nhan_hieu']}'>Sửa </td>";
		echo		"<td align='center'>
						<a onclick=\"javascript: return onXoaHieu({$value['id_nhan_hieu']}, '{$value['ten_nhan_hieu']}')\" href=#>Xóa</a>";
		echo 		"</td>";
		echo	"</tr>";
		}
?>
            </tbody>
        </table>
    </div>
	
<?php	
	require_once('template/template2.phtml');
?>